package normalisation;

import java.util.ArrayList;

public class FrenchStemmer extends org.tartarus.snowball.ext.frenchStemmer {

    private static short REPEAT = 1;

    public FrenchStemmer() {
    }

    public ArrayList<String> normalize(String text) {
        ArrayList<String> words = (new FrenchTokenizer()).normalize(text);
        ArrayList<String> result = new ArrayList<String>();
        for (int k = words.size() - 1; k >= 0; k--) {
            this.setCurrent(words.get(k));
            for (int i = REPEAT; i != 0; i--) {
                this.stem();
            }

            result.add(this.getCurrent());
        }
        
        return result;
    }
}
